import {produce} from "immer"

//声明一个数组, 理解为是当前的状态值
const baseState = [
  {
      title: "Learn TypeScript",
      done: true
  },
  {
      title: "Try Immer",
      done: false
  }
];

//下一个状态值
const nextState = produce(baseState, draft => {
  draft[1].done = true
  draft.push({title: "Tweet about it"})
});

console.log(nextState === baseState);
